<HTML>
<HEAD>
<TITLE>Most Used CSPICE APIs</TITLE>
</HEAD>
<BODY style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<A NAME="TOP"></A>


<TABLE STYLE="text-align: left; margin-left: auto; margin-right: auto; width: 800px;" BORDER="0" CELLPADDING="5" CELLSPACING="2">
<TBODY>

<TR>
  <TD STYLE="background-color: rgb(153, 153, 153); vertical-align: middle; text-align: center;">
  <DIV ALIGN="right">
    <SMALL><SMALL><A HREF="../index.html">Main Page</A></SMALL></SMALL>
  </DIV>
  <B>Most Used CSPICE APIs</B> </TD>
</TR>

<TR>
  <TD STYLE="vertical-align: top;">

<HR>

<H3>CSPICE APIs for accessing SPICE kernel data</H3>
<UL>
<LI><A HREF="#A">Loading and unloading SPICE kernels</A>&nbsp;
<LI><A HREF="#B">Converting between UTC and Ephemeris Time (LSK)</A>&nbsp;
<LI><A HREF="#C">Converting between Ephemeris Time and spacecraft clock (SCLK)</A>&nbsp;
<LI><A HREF="#D">Retrieving constants and orientation for natural bodies (PCK)</A>&nbsp;
<LI><A HREF="#E">Computing transformations between reference frames (FK)</A>&nbsp;
<LI><A HREF="#F">Computing positions of spacecraft and natural bodies (SPK)</A>&nbsp;
<LI><A HREF="#G">Computing orientations of spacecraft and instruments (CK)</A>&nbsp;
<LI><A HREF="#H">Retrieving instrument parameters (IK)</A>&nbsp;
<LI><A HREF="#I">Mapping between object names and NAIF IDs</A>&nbsp;
</UL>

<H3>CSPICE APIs for computing derived geometry</H3>
<UL>
<LI><A HREF="#N">Computing planetocentric, planetodetic, and planetographic coordinates</A>&nbsp;
<LI><A HREF="#J">Computing surface intercept point</A>&nbsp;
<LI><A HREF="#K">Computing sub-observer and sub-solar points</A>&nbsp;
<LI><A HREF="#L">Computing illumination angles</A>&nbsp;
<LI><A HREF="#M">Computing and propagating orbital elements</A>&nbsp;
</UL>

<H3>CSPICE APIs for finding times of geometric events</H3>
<UL>
<LI><A HREF="#1">Finding times of events satisfying numerical constraints</A>&nbsp;
<LI><A HREF="#2">Finding times of events satisfying FOV constraints</A>&nbsp;
<LI><A HREF="#3">Finding times of occultations</A>&nbsp;
</UL>

<H3>CSPICE APIs for coordinate conversions</H3>
<UL>
<LI><A HREF="#O">Converting from and to rectangular coordinates</A>&nbsp;
<LI><A HREF="#P">Converting from and to spherical coordinates</A>&nbsp;
<LI><A HREF="#Q">Converting from and to cylindrical coordinates</A>&nbsp;
<LI><A HREF="#R">Converting from and to latitudinal coordinates</A>&nbsp;
<LI><A HREF="#S">Converting from and to R, RA, DEC</A>&nbsp;
<LI><A HREF="#T">Converting from and to geodetic coordinates</A>&nbsp;
</UL>

<H3>CSPICE APIs for operations with 3D vectors and matrices</H3>
<UL>
<LI><A HREF="#U">Performing simple operations on 3D vectors</A>&nbsp;
<LI><A HREF="#W">Performing simple operations on 3x3 matrices</A>&nbsp;
<LI><A HREF="#V">Projecting, combining and rotating 3D vectors</A>&nbsp;
<LI><A HREF="#X">Creating and converting transformation matrices</A>&nbsp;
</UL>

<H3>Miscellaneous CSPICE APIs</H3>
<UL>
<LI><A HREF="#Y">Accessing physical and mathematical constants</A>&nbsp;
</UL>

<HR>

<A NAME="A"></A><p align="right"><a href="#TOP"><small>Top</small></a></p>
<H3>Loading and Unloading SPICE Kernels</H3>

<H4>APIs:</H4>
<UL>
<LI><SAMP><a href="../cspice/furnsh_c.html">furnsh_c</a></SAMP> - loads an individual kernel or a collection of kernels
<LI><SAMP><a href="../cspice/unload_c.html">unload_c</a></SAMP> - unloads an individual kernel or a collection of kernels
</UL>

<H4>Brief Example:</H4>
<PRE>
   Generic LSK and PCK files listed in a meta-kernel named
   "mykernels.furnsh" and containing

      \begindata
         KERNELS_TO_LOAD = (
                            '/kernels/gen/lsk/naif0008.tls'
                            '/kernels/gen/pck/pck00008.tps'
                           )
      \begintext

   are loaded with a single call to <a href="../cspice/furnsh_c.html">furnsh_c</a>:

      <a href="../cspice/furnsh_c.html">furnsh_c</a> ( "mykernels.furnsh" );
</PRE>
<H4>Reference documents:</H4>
<UL>
<LI><SAMP><a href="../req/kernel.html">kernel.req</a></SAMP> - reference on loading/unloading kernels and text kernel format
</UL>

<HR>

<A NAME="B"></A><p align="right"><a href="#TOP"><small>Top</small></a></p>
<H3>Converting between UTC and Ephemeris Time (LSK)</H3>

<H4>APIs:</H4>
<UL>
<LI><SAMP><a href="../cspice/furnsh_c.html">furnsh_c</a></SAMP> - loads an individual kernel or a collection of kernels
<LI><SAMP><a href="../cspice/str2et_c.html">str2et_c</a></SAMP> - converts a time string to ET seconds past J2000
<LI><SAMP><a href="../cspice/timout_c.html">timout_c</a></SAMP> - converts ET seconds past J2000 to a time string
</UL>

<H4>Brief Example:</H4>
<PRE>
   The following example loads an LSK file, converts a UTC string to ET
   seconds, adds 1 day and converts TDB seconds back to a UTC string in
   ISO DOY format:

      SpiceDouble   et;
      SpiceChar     utc[32];

      /*
         load LSK file 
      */
      <a href="../cspice/furnsh_c.html">furnsh_c</a>  ( "naif0008.tls" );

      /*
         convert UTC to ET 
      */
      <a href="../cspice/str2et_c.html">str2et_c</a>  ( "2005 DEC 31 12:00", &amp;et );

      /*
         add 1 day to ET and convert it back to UTC 
      */
      <a href="../cspice/timout_c.html">timout_c</a> ( et+<a href="../cspice/spd_c.html">spd_c</a>(), "YYYY-DOYTHR:MN:SC.### ::RND", 32, utc ); 
</PRE>
<H4>Reference documents:</H4>
<UL>
<LI><SAMP><a href="../req/time.html">time.req</a></SAMP> - reference on time systems and conversions supported in SPICE
<LI><SAMP><a href="../req/kernel.html">kernel.req</a></SAMP> - reference on loading/unloading kernels and text kernel format
</UL>

<HR>

<A NAME="C"></A><p align="right"><a href="#TOP"><small>Top</small></a></p>
<H3>Converting between Ephemeris Time and Spacecraft Clock (SCLK)</H3>

<H4>APIs:</H4>
    <code></code><UL>
<LI><SAMP><a href="../cspice/furnsh_c.html">furnsh_c</a></SAMP> - loads individual kernels and collections of kernels
<LI><SAMP><a href="../cspice/scs2e_c.html">scs2e_c</a></SAMP> - converts an SCLK string to ET seconds past J2000
<LI><SAMP><a href="../cspice/sce2s_c.html">sce2s_c</a></SAMP> - converts ET seconds past J2000 to SCLK string
<LI><SAMP><a href="../cspice/sct2e_c.html">sct2e_c</a></SAMP> - converts an encoded SCLK to ET seconds past J2000
<LI><SAMP><a href="../cspice/sce2c_c.html">sce2c_c</a></SAMP> - converts ET seconds past J2000 to encoded SCLK
<LI><SAMP><a href="../cspice/scencd_c.html">scencd_c</a></SAMP> - converts an SCLK string to encoded SCLK
<LI><SAMP><a href="../cspice/scdecd_c.html">scdecd_c</a></SAMP> - converts an  encoded SCLK to SCLK string
</UL>

<H4>Brief Example:</H4>
<PRE>
   The following example loads an LSK file and an MGS SCLK file, then
   converts an MGS SCLK string to ET and encoded SCLK:

      SpiceChar   * sclk;
      SpiceDouble   et;
      SpiceDouble   sclkdp;
      SpiceInt      scid = -94;

      /*
         load LSK and SCLK files 
      */
      <a href="../cspice/furnsh_c.html">furnsh_c</a> ( "naif0008.tls" );
      <a href="../cspice/furnsh_c.html">furnsh_c</a> ( "mgs_sclkscet_00061.tsc" );

      /*
         convert string SCLK to ET and to encoded SCLK 
      */
      sclk = "820584056:121";
      <a href="../cspice/scs2e_c.html">scs2e_c</a>  ( scid, sclk, &amp;et );
      <a href="../cspice/scencd_c.html">scencd_c</a> ( scid, sclk, &amp;sclkdp );
</PRE>
<H4>Reference documents:</H4>
<UL>
<LI><SAMP><a href="../req/sclk.html">sclk.req</a></SAMP> - reference on on-board clock (SCLK) implementation in SPICE
<LI><SAMP><a href="../req/kernel.html">kernel.req</a></SAMP> - reference on loading/unloading kernels and text kernel format
</UL>

<HR>

<A NAME="D"></A><p align="right"><a href="#TOP"><small>Top</small></a></p>
<H3>Constants and Orientation for Natural Bodies (PCK)</H3>

<H4>APIs:</H4>
<UL>
<LI><SAMP><a href="../cspice/furnsh_c.html">furnsh_c</a></SAMP> - loads individual kernels and collections of kernels
<LI><SAMP><a href="../cspice/bodfnd_c.html">bodfnd_c</a></SAMP> - determines whether values exist for some item for a body in the kernel pool.
<LI><SAMP><a href="../cspice/bodvrd_c.html">bodvrd_c</a></SAMP> - retrieves from the kernel pool the values of an item associated with a body.
<LI><SAMP><a href="../cspice/pxform_c.html">pxform_c</a></SAMP> - returns the 3x3 matrix rotating a position vector one frame to another.
<LI><SAMP><a href="../cspice/sxform_c.html">sxform_c</a></SAMP> - returns the 6x6 matrix rotating a state vector from one frame to another.
<LI><SAMP><a href="../cspice/pckfrm_c.html">pckfrm_c</a></SAMP> - finds the set of reference frame class ID codes of all frames in a binary PCK file.
<LI><SAMP><a href="../cspice/pckcov_c.html">pckcov_c</a></SAMP> - finds the coverage window for a reference frame in a binary PCK file.
</UL>

<H4>Brief Example:</H4>
<PRE>
   The following example retrieves radii for Mars and computes
   orientation of the Mars body-fixed frame:

      SpiceDouble   et;
      SpiceDouble   mat[3][3];
      SpiceDouble   radii[3];
      SpiceInt      n;

      /*
         load LSK and PCK files 
      */
      <a href="../cspice/furnsh_c.html">furnsh_c</a> ( "naif0008.tls" );
      <a href="../cspice/furnsh_c.html">furnsh_c</a> ( "pck00008.tpc" );

      /*
         retrieve Mars radii 
      */
      <a href="../cspice/bodvrd_c.html">bodvrd_c</a> ( "MARS", "RADII", 3, &amp;n, radii );

      /*
         convert UTC to ET 
      */
      <a href="../cspice/str2et_c.html">str2et_c</a> ( "2005-DEC-28 12:00", &amp;et );

      /*
         compute Mars orientation relative to the J2000 frame 
      */
      <a href="../cspice/pxform_c.html">pxform_c</a> ( "J2000", "IAU_MARS", et, mat );
</PRE>
<H4>Reference documents:</H4>
<UL>
<LI><SAMP><a href="../req/pck.html">pck.req</a></SAMP> - reference on Planetary Constants Kernel (PCK) subsystem of SPICE
<LI><SAMP><a href="../req/kernel.html">kernel.req</a></SAMP> - reference on loading/unloading kernels and text kernel format
</UL>

<HR>

<A NAME="E"></A><p align="right"><a href="#TOP"><small>Top</small></a></p>
<H3>Computing Transformations Between Frames (FK)</H3>

<H4>APIs:</H4>
<UL>
<LI><SAMP><a href="../cspice/furnsh_c.html">furnsh_c</a></SAMP> - loads individual kernels and collections of kernels
<LI><SAMP><a href="../cspice/pxform_c.html">pxform_c</a></SAMP> - returns the 3x3 matrix rotating a position vector one frame to another.
<LI><SAMP><a href="../cspice/sxform_c.html">sxform_c</a></SAMP> - returns the 6x6 matrix rotating a state vector from one frame to another.
</UL>

<H4>Brief Example:</H4>
<PRE>
   The following example computes orientation of the CASSINI ISS WAC
   camera relative to the Saturn body-fixed frame:

      SpiceDouble   et;
      SpiceDouble   mat[3][3];

      /*
         load kernels: LSK, PCK, CASSINI SCLK, FK and CK 
      */
      <a href="../cspice/furnsh_c.html">furnsh_c</a> ( "naif0008.tls" );
      <a href="../cspice/furnsh_c.html">furnsh_c</a> ( "pck00008.tpc" );
      <a href="../cspice/furnsh_c.html">furnsh_c</a> ( "cas00101.tsc" );
      <a href="../cspice/furnsh_c.html">furnsh_c</a> ( "cas_v39.tf" );
      <a href="../cspice/furnsh_c.html">furnsh_c</a> ( "05362_06002ra.bc" );
      
      /*
         convert UTC to ET 
      */
      <a href="../cspice/str2et_c.html">str2et_c</a> ( "2005-DEC-28 12:00", &amp;et );

      /*
         compute orientation of CASSINI relative to J2000 frame 
      */
      <a href="../cspice/pxform_c.html">pxform_c</a> ( "IAU_SATURN", "CASSINI_ISS_WAC", et, mat );
</PRE>
<H4>Reference documents:</H4>
<UL>
<LI><SAMP><a href="../req/frames.html">frames.req</a></SAMP> - reference on Frames Kernel (FK) and Frames subsystem of SPICE
<LI><SAMP><a href="../req/kernel.html">kernel.req</a></SAMP> - reference on loading/unloading kernels and text kernel format
</UL>

<HR>

<A NAME="F"></A><p align="right"><a href="#TOP"><small>Top</small></a></p>
<H3>Computing Positions of Spacecraft and Natural Bodies (SPK)</H3>

<H4>APIs:</H4>
<UL>
<LI><SAMP><a href="../cspice/furnsh_c.html">furnsh_c</a></SAMP> - loads individual kernels and collections of kernels
<LI><SAMP><a href="../cspice/spkezr_c.html">spkezr_c</a></SAMP> - returns the state of a target body relative to an observing body
<LI><SAMP><a href="../cspice/spkpos_c.html">spkpos_c</a></SAMP> - returns the position of a target body relative to an observing body.
<LI><SAMP><a href="../cspice/spkobj_c.html">spkobj_c</a></SAMP> - finds the set of ID codes for all objects in a specified SPK file.
<LI><SAMP><a href="../cspice/spkcov_c.html">spkcov_c</a></SAMP> - finds the coverage window for a specified object in a specified SPK file.
</UL>

<H4>Brief Example:</H4>
<PRE>
   The following example computes the geometric state (position and
   velocity) of MGS relative to Mars in the J2000 reference frame:

      SpiceDouble   et;
      SpiceDouble   state[6];
      SpiceDouble   lt;

      /*
         load kernels: LSK and MGS and DE SPKs 
      */
      <a href="../cspice/furnsh_c.html">furnsh_c</a> ( "naif0008.tls" );
      <a href="../cspice/furnsh_c.html">furnsh_c</a> ( "de405.bsp" );
      <a href="../cspice/furnsh_c.html">furnsh_c</a> ( "mgs_ext22.bsp" );

      /*
         convert UTC to ET 
      */
      <a href="../cspice/str2et_c.html">str2et_c</a> ( "2006 JAN 31 01:00", &amp;et );

      /*
         compute geometric state of MGS relative to Mars 
      */
      <a href="../cspice/spkezr_c.html">spkezr_c</a> ( "MGS", et, "J2000", "NONE", "MARS", state, 
                 &amp;lt );
</PRE>
<H4>Reference documents:</H4>
<UL>
<LI><SAMP><a href="../req/spk.html">spk.req</a></SAMP> - reference on Spacecraft and Planet Ephemeris (SPK) subsystem of SPICE
<LI><SAMP><a href="../req/frames.html">frames.req</a></SAMP> - reference on Frames Kernel (FK) and Frames subsystem of SPICE
<LI><SAMP><a href="../req/kernel.html">kernel.req</a></SAMP> - reference on loading/unloading kernels and text kernel format
</UL>

<HR>

<A NAME="G"></A><p align="right"><a href="#TOP"><small>Top</small></a></p>
<H3>Computing Orientation for Spacecraft and Instruments (CK)</H3>

<H4>APIs:</H4>
<UL>
<LI><SAMP><a href="../cspice/furnsh_c.html">furnsh_c</a></SAMP> - loads individual kernels and collections of kernels
<LI><SAMP><a href="../cspice/pxform_c.html">pxform_c</a></SAMP> - returns the 3x3 matrix rotating a position vector one frame to another.
<LI><SAMP><a href="../cspice/sxform_c.html">sxform_c</a></SAMP> - returns the 6x6 matrix rotating a state vector from one frame to another.
<LI><SAMP><a href="../cspice/ckobj_c.html">ckobj_c</a></SAMP> - finds the set of ID codes for all objects in a specified CK file.
<LI><SAMP><a href="../cspice/ckcov_c.html">ckcov_c</a></SAMP> - finds the coverage window for a specified object in a specified CK file.
<LI><SAMP><a href="../cspice/ckgp_c.html">ckgp_c</a></SAMP> - gets pointing for a specified CK ID at a specified SCLK time.
<LI><SAMP><a href="../cspice/ckgpav_c.html">ckgpav_c</a></SAMP> - gets pointing and angular velocity for a specified CK ID at a specified SCLK time.
</UL>

<H4>Brief Example:</H4>
<PRE>
   The following example computes orientation of the CASSINI spacecraft
   provided in CK files using the Frames subsystem routine <a href="../cspice/pxform_c.html">pxform_c</a>:

      SpiceDouble   et;
      SpiceDouble   mat[3][3];

      /*
         load kernels: LSK, CASSINI SCLK, FK and CK 
      */
      <a href="../cspice/furnsh_c.html">furnsh_c</a> ( "naif0008.tls" );
      <a href="../cspice/furnsh_c.html">furnsh_c</a> ( "cas00101.tsc" );
      <a href="../cspice/furnsh_c.html">furnsh_c</a> ( "cas_v39.tf" );
      <a href="../cspice/furnsh_c.html">furnsh_c</a> ( "05362_06002ra.bc" );
      
      /*
         convert UTC to ET 
      */
      <a href="../cspice/str2et_c.html">str2et_c</a> ( "2005-DEC-28 12:00", &amp;et );

      /*
         compute orientation of CASSINI relative to J2000 frame 
      */
      <a href="../cspice/pxform_c.html">pxform_c</a> ( "J2000", "CASSINI_SC_COORD", et, mat );
</PRE>
<H4>Reference documents:</H4>
<UL>
<LI><SAMP><a href="../req/ck.html">ck.req</a></SAMP> - reference on spacecraft orientation (CK) subsystem of SPICE
<LI><SAMP><a href="../req/frames.html">frames.req</a></SAMP> - reference on Frames Kernel (FK) and Frames subsystem of SPICE
<LI><SAMP><a href="../req/kernel.html">kernel.req</a></SAMP> - reference on loading/unloading kernels and text kernel format
</UL>

<HR>

<A NAME="H"></A><p align="right"><a href="#TOP"><small>Top</small></a></p>
<H3>Retrieving Instrument Parameters (IK)</H3>

<H4>APIs:</H4>
<UL>
<LI><SAMP><a href="../cspice/furnsh_c.html">furnsh_c</a></SAMP> - loads individual kernels and collections of kernels
<LI><SAMP><a href="../cspice/getfov_c.html">getfov_c</a></SAMP> - returns the field-of-view (FOV) configuration for a specified instrument.
<LI><SAMP><a href="../cspice/gdpool_c.html">gdpool_c</a></SAMP> - returns the double precision value of a kernel variable from the kernel pool.
<LI><SAMP><a href="../cspice/gipool_c.html">gipool_c</a></SAMP> - returns the integer value of a kernel variable from the kernel pool.
<LI><SAMP><a href="../cspice/gcpool_c.html">gcpool_c</a></SAMP> - returns the character value of a kernel variable from the kernel pool.
</UL>

<H4>Brief Example:</H4>
<PRE>
   The following example retrieves the M01 THEMIS IR camera focal
   length and FOV parameters:

      SpiceBoolean  found;
      SpiceChar     frame[32];
      SpiceChar     shape[32];
      SpiceDouble   fl;
      SpiceDouble   bsight[3];
      SpiceDouble   bounds[4][3];
      SpiceInt      n;

      /*
         load THEMIS IK 
      */
      <a href="../cspice/furnsh_c.html">furnsh_c</a> ( "m01_themis_v31.ti" );

      /*
         retrieve M01 THEMIS IR pixel size 
      */
      <a href="../cspice/gdpool_c.html">gdpool_c</a> ( "INS-53031_FOCAL_LENGTH", 0, 1, &amp;n, &amp;fl, 
                 &amp;found );

      /*
         retrieve M01 THEMIS IR FOV parameters 
      */
      <a href="../cspice/getfov_c.html">getfov_c</a> ( -53031, 4, 32, 32, shape, frame, bsight, &amp;n, 
                 bounds );
</PRE>
<H4>Reference documents:</H4>
<UL>
<LI><SAMP><a href="../req/kernel.html">kernel.req</a></SAMP> - reference on loading/unloading kernels and text kernel format
</UL>

<HR>

<A NAME="I"></A><p align="right"><a href="#TOP"><small>Top</small></a></p>
<H3>Mapping Between Object Names and NAIF IDs</H3>

<H4>APIs:</H4>
<UL>
<LI><SAMP><a href="../cspice/furnsh_c.html">furnsh_c</a></SAMP> - loads individual kernels and collections of kernels
<LI><SAMP><a href="../cspice/bodc2n_c.html">bodc2n_c</a></SAMP> - translates the NAIF integer code of a body into a common name for that body.
<LI><SAMP><a href="../cspice/bodn2c_c.html">bodn2c_c</a></SAMP> - translates the name of a body or object to the corresponding NAIF integer ID code.
</UL>

<H4>Brief Example:</H4>
<PRE>
   The following example uses <a href="../cspice/bodn2c_c.html">bodn2c_c</a> to get the NAIF ID for Phobos
   (built into the SPICE system) and for the M01 THEMIS IR camera
   (defined in the M01 FK file):

      SpiceBoolean  found;
      Spiceint      phobos_id;
      Spiceint      themis_ir_id;

      /*
         load FK defining M01 name-ID mappings 
      */      
      <a href="../cspice/furnsh_c.html">furnsh_c</a> ( "m01_v28.tf" );

      /*
         get NAIF ID for Phobos 
      */
      <a href="../cspice/bodn2c_c.html">bodn2c_c</a> ( "PHOBOS", &amp;phobos_id, &amp;found );

      /*
         get NAIF ID for THEMIS IR camera 
      */
      <a href="../cspice/bodn2c_c.html">bodn2c_c</a> ( "M01_THEMIS_IR", &amp;themis_ir_id, &amp;found );
</PRE>
<H4>Reference documents:</H4>
<UL>
<LI><SAMP><a href="../req/naif_ids.html">naif_ids.req</a></SAMP> - reference on object names and IDs supported in SPICE
<LI><SAMP><a href="../req/kernel.html">kernel.req</a></SAMP> - reference on loading/unloading kernels and text kernel format
</UL>

<HR>

<A NAME="N"></A><p align="right"><a href="#TOP"><small>Top</small></a></p>
<H3>Computing Planetocentric, Planetodetic, and Planetographic Coordinates</H3>

<H4>APIs:</H4>
<UL>
<LI><SAMP><a href="../cspice/reclat_c.html">reclat_c</a></SAMP> - converts from rectangular to planetocentric coordinates.
<LI><SAMP><a href="../cspice/latrec_c.html">latrec_c</a></SAMP> - converts from planetocentric to rectangular coordinates.
<LI><SAMP><a href="../cspice/srfrec_c.html">srfrec_c</a></SAMP> - converts from planetocentric lat/lon of a surface point on a body to rectangular coordinates.
<LI><SAMP><a href="../cspice/recgeo_c.html">recgeo_c</a></SAMP> - converts from rectangular to geodetic coordinates.
<LI><SAMP><a href="../cspice/georec_c.html">georec_c</a></SAMP> - converts from geodetic to rectangular coordinates.
<LI><SAMP><a href="../cspice/recpgr_c.html">recpgr_c</a></SAMP> - converts from rectangular to planetographic coordinates.
<LI><SAMP><a href="../cspice/pgrrec_c.html">pgrrec_c</a></SAMP> - converts from planetographic to rectangular coordinates.
</UL>


<H4>Brief Example:</H4>
<PRE>
   The following example computes the planetocentric, planetodetic and
   planetographic coordinates for a point given as a Cartesian vector
   with respect to Mars in the Mars body-fixed frame (IAU_MARS):

      SpiceDouble   vec[3];
      SpiceDouble   radii[3];
      SpiceDouble   f;
      SpiceDouble   pcr,   pclon, pclat;
      SpiceDouble   pdalt, pdlon, pdlat;
      SpiceDouble   pgalt, pglon, pglat;
      SpiceInt      n;

      /*
         load PCK file 
      */
      <a href="../cspice/furnsh_c.html">furnsh_c</a>( "pck00008.tpc" );

      /*
         retrieve Mars radii 
      */
      <a href="../cspice/bodvrd_c.html">bodvrd_c</a>( "MARS", "RADII", 3, &amp;n, radii );

      /*
         package 3D vector 
      */
      <a href="../cspice/vpack_c.html">vpack_c</a> ( 3373.850, -351.034, -117.267, vec );

      /*
         compute planetocentric coordinates 
      */
      <a href="../cspice/reclat_c.html">reclat_c</a>( vec, &amp;pcr, &amp;pclon, &amp;pclat );

      /*
         compute planetodetic coordinates 
      */
      <a href="../cspice/recgeo_c.html">recgeo_c</a>( vec, radii[0], f, &amp;pdlon, &amp;pdlat, 
                &amp;pdalt );

      /*
         compute planetographic coordinates 
      */
      <a href="../cspice/recpgr_c.html">recpgr_c</a>( "MARS", vec, radii[0], f, &amp;pglon, &amp;pglat, 
                &amp;pgalt );
</PRE>

<H4>Reference documents:</H4>
<UL>
<LI><SAMP><a href="../req/pck.html">pck.req</a></SAMP> - reference on Planetary Constants Kernel (PCK) subsystem of SPICE
</UL>

<HR>

<A NAME="J"></A><p align="right"><a href="#TOP"><small>Top</small></a></p>
<H3>Computing Surface Intercept Point</H3>

<H4>APIs:</H4>
<UL>
<LI><SAMP><a href="../cspice/sincpt_c.html">sincpt_c</a></SAMP> - computes the surface intercept point of the ray on a body at a specified epoch.
</UL>

<H4>Brief Example:</H4>
<PRE>
   The following example computes the surface intercept point of the
   MGS MOC NA camera boresight with the surface of Mars:

      SpiceBoolean  found;
      SpiceChar     frame[32];
      SpiceChar     shape[32];
      SpiceDouble   et;
      SpiceDouble   bsight[3];
      SpiceDouble   bounds [4][3];
      SpiceDouble   spoint[3];
      SpiceDouble   trgepc;
      SpiceDouble   srfvec[3];
      SpiceInt      n;

      /*
         load kernels: LSK, PCK, MGS SCLK, planet/satellite 
         ephemeris SPK, MGS spacecraft SPK, MGS spacecraft
         CK, MGS FK, and MOC IK
      */
      <a href="../cspice/furnsh_c.html">furnsh_c</a> ( "naif0008.tls" );
      <a href="../cspice/furnsh_c.html">furnsh_c</a> ( "mars_iau2000_v0.tpc" );
      <a href="../cspice/furnsh_c.html">furnsh_c</a> ( "mgs_sclkscet_00061.tsc" );
      <a href="../cspice/furnsh_c.html">furnsh_c</a> ( "mar063.bsp" );
      <a href="../cspice/furnsh_c.html">furnsh_c</a> ( "mgs_ext22.bsp" );
      <a href="../cspice/furnsh_c.html">furnsh_c</a> ( "mgs_sc_ext22.bc" );
      <a href="../cspice/furnsh_c.html">furnsh_c</a> ( "mgs_v10.tf" );
      <a href="../cspice/furnsh_c.html">furnsh_c</a> ( "mgs_moc_v20.ti" );

      /*
         retrieve MOC NA camera boresight direction 
      */
      <a href="../cspice/getfov_c.html">getfov_c</a> ( -94031, 4, 32, 32, shape, frame, bsight, &amp;n, 
                 bounds );

      /*
         convert UTC to ET 
      */
      <a href="../cspice/str2et_c.html">str2et_c</a> ( "2006 JAN 31 01:00", &amp;et );

      /*
         compute surface intercept point 
      */
      <a href="../cspice/sincpt_c.html">sincpt_c</a> ( "Ellipsoid", "MARS", et, "IAU_MARS",  
                 "CN+S", "MGS", frame, bsight, 
                 spoint, &amp;trgepc, srfvec, &amp;found );
</PRE>

<HR>

<A NAME="K"></A><p align="right"><a href="#TOP"><small>Top</small></a></p>
<H3>Computing Sub-observer and Sub-solar Points</H3>

<H4>APIs:</H4>
<UL>
<LI><SAMP><a href="../cspice/subpnt_c.html">subpnt_c</a></SAMP> - computes the sub-observer point on a body at a particular epoch.
<LI><SAMP><a href="../cspice/subslr_c.html">subslr_c</a></SAMP> - computes the sub-solar point on a body as seen by an observer at a particular epoch.
</UL>

<H4>Brief Example:</H4>
<PRE>
   The following example computes the sub-spacecraft and sub-solar
   points on Mars for MGS:

      SpiceDouble   et;
      SpiceDouble   subsc[3];
      SpiceDouble   subsolar[3];
      SpiceDouble   srfvec[3];
      SpiceDouble   trgepc;

      /*
         load kernels: LSK, PCK, planet/satellite SPK
         and MGS spacecraft SPK
      */
      <a href="../cspice/furnsh_c.html">furnsh_c</a> ( "naif0008.tls" );
      <a href="../cspice/furnsh_c.html">furnsh_c</a> ( "mars_iau2000_v0.tpc" );
      <a href="../cspice/furnsh_c.html">furnsh_c</a> ( "mar063.bsp" );
      <a href="../cspice/furnsh_c.html">furnsh_c</a> ( "mgs_ext22.bsp" );

      /*
         convert UTC to ET 
      */
      <a href="../cspice/str2et_c.html">str2et_c</a> ( "2006 JAN 31 01:00", &amp;et );

      /*
         compute sub-spacecraft point 
      */
      <a href="../cspice/subpnt_c.html">subpnt_c</a> ( "Near point: ellipsoid",
                 "MARS", et, "IAU_MARS", "LT+S", "MGS",
                 subsc, &amp;trgepc, srfvec );

      /*
         compute sub-solar point 
      */
      <a href="../cspice/subslr_c.html">subslr_c</a> ( "Near point: ellipsoid",
                 "MARS", et, "IAU_MARS", "LT+S", "MGS",
                 subsolar, &amp;trgepc, srfvec );
</PRE>

<HR>

<A NAME="L"></A><p align="right"><a href="#TOP"><small>Top</small></a></p>
<H3>Computing Illumination Angles</H3>

<H4>APIs:</H4>
<UL>
<LI><SAMP><a href="../cspice/ilumin_c.html">ilumin_c</a></SAMP> - finds the illumination angles at a specified surface point of a target body.
</UL>

<H4>Brief Example:</H4>
<PRE>
   The following example computes the illumination angles for a point
   specified using planetocentric coordinates, observed by MGS:

      SpiceDouble   r   = 3390.42;
      SpiceDouble   lon =  175.30;
      SpiceDouble   lat =  -14.59;
      SpiceDouble   point[3];
      SpiceDouble   et;
      SpiceDouble   srfvec[3];
      SpiceDouble   trgepc;
      SpiceDouble   phase, solar, emissn;

      /*
         load kernels: LSK, PCK, planet/satellite SPK
         and MGS spacecraft SPK
      */
      <a href="../cspice/furnsh_c.html">furnsh_c</a> ( "naif0008.tls" );
      <a href="../cspice/furnsh_c.html">furnsh_c</a> ( "mars_iau2000_v0.tpc" );
      <a href="../cspice/furnsh_c.html">furnsh_c</a> ( "mar063.bsp" );
      <a href="../cspice/furnsh_c.html">furnsh_c</a> ( "mgs_ext22.bsp" );

      /*
         convert planetocentric r/lon/lat to Cartesian vector 
      */
      <a href="../cspice/latrec_c.html">latrec_c</a>( r, lon * <a href="../cspice/rpd_c.html">rpd_c</a>(), lat * rpd_c(), point );

      /*
         convert UTC to ET 
      */
      <a href="../cspice/str2et_c.html">str2et_c</a> ( "2006 JAN 31 01:00", &amp;et );

      /*
         compute illumination angles 
      */
      <a href="../cspice/ilumin_c.html">ilumin_c</a> ( "Ellipsoid", "MARS",  et, "IAU_MARS", 
                 "LT+S", "MGS", point,  
                 &amp;trgepc, srfvec, &amp;phase, &amp;solar, &amp;emissn );
</PRE>

<HR>

<A NAME="M"></A><p align="right"><a href="#TOP"><small>Top</small></a></p>
<H3>Computing and Propagating Orbital Elements</H3>

<H4>APIs:</H4>
<UL>
<LI><SAMP><a href="../cspice/conics_c.html">conics_c</a></SAMP> - determines the state of an orbiting body from a set orbital elements.
<LI><SAMP><a href="../cspice/oscelt_c.html">oscelt_c</a></SAMP> - determines the set of orbital elements corresponding to the state of a body.
</UL>

<H4>Brief Example:</H4>
<PRE>
   The following example computes the set of orbital elements for the
   state of the Mars Express spacecraft at a given time:

      SpiceInt      n;
      SpiceDouble   gm;
      SpiceDouble   et;
      SpiceDouble   state[6];
      SpiceDouble   lt;
      SpiceDouble   elts[8];

      /*
         load kernels: LSK, MEX trajectory SPK, and gravity PCK 
      */
      <a href="../cspice/furnsh_c.html">furnsh_c</a> ( "naif0008.tls" );
      <a href="../cspice/furnsh_c.html">furnsh_c</a> ( "ORMM__050901000000_00165.BSP" );
      <a href="../cspice/furnsh_c.html">furnsh_c</a> ( "DE403-MASSES.TPC" );

      /*
         retrieve GM for Mars 
      */
      <a href="../cspice/bodvrd_c.html">bodvrd_c</a> ( "MARS", "GM", 1, &amp;n, gm );

      /*
         convert UTC to ET 
      */
      <a href="../cspice/str2et_c.html">str2et_c</a> ( "2005 SEP 02 04:50:45", &amp;et );

      /*
         compute state of MEX at given UTC 
      */
      <a href="../cspice/spkezr_c.html">spkezr_c</a> ( "MEX", et, "MARSIAU", "NONE", "MARS", 
                 state, &amp;lt );

      /*
         compute orbital elements 
      */
      <a href="../cspice/oscelt_c.html">oscelt_c</a> ( state, et, gm, elts );
</PRE>

<HR>

<A NAME="1"></A><p align="right"><a href="#TOP"><small>Top</small></a></p>
<H3>Finding times of events satisfying numerical constraints</H3>

<H4>APIs:</H4>
<UL>
<LI><SAMP><a href="../cspice/gfdist_c.html">gfdist_c</a></SAMP> - determines time intervals when a specified constraint on observer-target distance is met.
<LI><SAMP><a href="../cspice/gfposc_c.html">gfposc_c</a></SAMP> - determines time intervals when a coordinate of an observer-target position vector satisfies a numerical constraint.
<LI><SAMP><a href="../cspice/gfrr_c.html">gfrr_c</a></SAMP> - determines time intervals when a specified constraint on the observer-target range rate is met.
<LI><SAMP><a href="../cspice/gfsep_c.html">gfsep_c</a></SAMP> - determines time intervals when the angular separation between the position vectors of two target bodies relative to an observer satisfies a numerical relationship.
<LI><SAMP><a href="../cspice/gfsntc_c.html">gfsntc_c</a></SAMP> - determines time intervals when a coordinate of a ray-surface intercept position vector satisfies a numerical constraint.
<LI><SAMP><a href="../cspice/gfsubc_c.html">gfsubc_c</a></SAMP> - determines time intervals when a coordinate of a sub-observer point position vector satisfies a numerical constraint.

</UL>

<H4>Brief Example:</H4>
<PRE>
   The following example determines time intervals between Jan 1 and
   and April 1, 2007 when the distance between the Moon and the Earth
   was greater than 400,000 km.

      #define  MAXWIN  200

      SPICEDOUBLE_CELL      ( cnfine, MAXWIN );
      SPICEDOUBLE_CELL      ( result, MAXWIN );

      SpiceDouble             adjust;
      SpiceDouble             et0;
      SpiceDouble             et1;
      SpiceDouble             refval;
      SpiceDouble             step;

      /*
         Load kernels.
      */
      <a href="../cspice/furnsh_c.html">furnsh_c</a>( "naif0008.tls" );
      <a href="../cspice/furnsh_c.html">furnsh_c</a>( "de421.bsp"    );

      /*
         Store the time bounds in the confinement window.
      */
      <a href="../cspice/str2et_c.html">str2et_c</a> ( "2007 JAN 1", &et0 );
      <a href="../cspice/str2et_c.html">str2et_c</a> ( "2007 APR 1", &et1 );

      <a href="../cspice/wninsd_c.html">wninsd_c</a> ( et0, et1, &cnfine );

      /*
         Set search parameters. Use a step size of 1 day (in units of
         seconds).
      */
      step   = <a href="../cspice/spd_c.html">spd_c</a>();
      refval = 4.e5;
      adjust = 0.0;

      /*
         Perform search.
      */
      <a href="../cspice/gfdist_c.html">gfdist_c</a> ( "MOON", "NONE", "EARTH", ">",     refval,   
                 adjust, step,   MAXWIN,  &cnfine, &result );
</PRE>
<H4>Reference documents:</H4>
<UL>
<LI><SAMP><a href="../req/gf.html">gf.req</a></SAMP> - reference on the Geometry Finder (GF) subsystem of SPICE
</UL>

<HR>

<A NAME="2"></A><p align="right"><a href="#TOP"><small>Top</small></a></p>
<H3>Finding times of events satisfying FOV constraints</H3>

<H4>APIs:</H4>
<UL>
<LI><SAMP><a href="../cspice/gfrfov_c.html">gfrfov_c</a></SAMP> - determines time intervals when a specified ray intersects the space bounded by the field-of-view (FOV) of a specified instrument.
<LI><SAMP><a href="../cspice/gftfov_c.html">gftfov_c</a></SAMP> - determines time intervals when a specified ephemeris object intersects the space bounded by the field-of-view (FOV) of a specified instrument.
</UL>

<H4>Brief Example:</H4>
<PRE>
   The following example determines time intervals between 09:00 and
   11:15 UTC on Jun 11, 2004 when Saturn's satellite Phoebe was within
   the FOV of the Cassini narrow angle camera (CASSINI_ISS_NAC).

      #define  MAXWIN         10000

      SPICEDOUBLE_CELL ( cnfine, MAXWIN );
      SPICEDOUBLE_CELL ( result, MAXWIN );

      SpiceDouble             et0;
      SpiceDouble             et1;
      SpiceDouble             stepsz;

      /*        
         Load kernels.
      */
      <a href="../cspice/furnsh_c.html">furnsh_c</a>( "naif0009.tls"               );
      <a href="../cspice/furnsh_c.html">furnsh_c</a>( "cpck05Mar2004.tpc"          );
      <a href="../cspice/furnsh_c.html">furnsh_c</a>( "981005_PLTEPH-DE405S.bsp"   );
      <a href="../cspice/furnsh_c.html">furnsh_c</a>( "020514_SE_SAT105.bsp"       );
      <a href="../cspice/furnsh_c.html">furnsh_c</a>( "030201AP_SK_SM546_T45.bsp"  );
      <a href="../cspice/furnsh_c.html">furnsh_c</a>( "cas_v37.tf"                 );
      <a href="../cspice/furnsh_c.html">furnsh_c</a>( "04135_04171pc_psiv2.bc"     );
      <a href="../cspice/furnsh_c.html">furnsh_c</a>( "cas00084.tsc"               );
      <a href="../cspice/furnsh_c.html">furnsh_c</a>( "cas_iss_v09.ti"             );

      /*        
         Store the time bounds in the confinement window.
      */
      <a href="../cspice/str2et_c.html">str2et_c</a> ( "2004 JUN 11 09:00", &et0 );
      <a href="../cspice/str2et_c.html">str2et_c</a> ( "2004 JUN 11 11:15", &et1 );

      <a href="../cspice/wninsd_c.html">wninsd_c</a> ( et0, et1, &cnfine );

      /*        
         Set search parameters. Use a step size of 10 seconds.
      */
      stepsz = 10.0;

      /*        
         Perform search.
      */
      <a href="../cspice/gftfov_c.html">gftfov_c</a> ( "CASSINI_ISS_NAC", "PHOEBE", "ELLIPSOID", 
                 "IAU_PHOEBE", "LT+S", "CASSINI", 
                 stepsz, &cnfine, &result );
</PRE>
<H4>Reference documents:</H4>
<UL>
<LI><SAMP><a href="../req/gf.html">gf.req</a></SAMP> - reference on the Geometry Finder (GF) subsystem of SPICE
</UL>

<HR>

<A NAME="3"></A><p align="right"><a href="#TOP"><small>Top</small></a></p>
<H3>Finding times of occultations</H3>

<H4>APIs:</H4>
<UL>
<LI><SAMP><a href="../cspice/gfoclt_c.html">gfoclt_c</a></SAMP> - determines time intervals when an observer sees one target occulted by another.
</UL>

<H4>Brief Example:</H4>
<PRE>
   The following example determines time intervals in December, 2001
   when the Sun is occulted by the Moon (solar eclipses) as seen from
   the center of the Earth.

      #define MAXWIN          200

      SPICEDOUBLE_CELL      ( cnfine, MAXWIN );
      SPICEDOUBLE_CELL      ( result, MAXWIN );

      SpiceDouble             et0;
      SpiceDouble             et1;
      SpiceDouble             step;

      /*        
         Load kernels.
      */        
      <a href="../cspice/furnsh_c.html">furnsh_c</a>( "naif0008.tls"  );
      <a href="../cspice/furnsh_c.html">furnsh_c</a>( "de421.bsp"     );
      <a href="../cspice/furnsh_c.html">furnsh_c</a>( "pck00008.tpc"  );

      /*        
         Store the time bounds the confinement window.
      */        
      <a href="../cspice/str2et_c.html">str2et_c</a> ( "2001 DEC 01", &et0 );
      <a href="../cspice/str2et_c.html">str2et_c</a> ( "2002 JAN 01", &et1 );

      <a href="../cspice/wninsd_c.html">wninsd_c</a> ( et0, et1, &cnfine );

      /*        
         Set search parameters. Select a 3-minute step.
      */        
      step = 180.0;

      /*        
         Perform search.
      */        
      <a href="../cspice/gfoclt_c.html">gfoclt_c</a> ( "ANY",                            
                 "MOON",    "ELLIPSOID",  "IAU_MOON", 
                 "SUN",     "ELLIPSOID",  "IAU_SUN", 
                 "LT",      "EARTH",      step, 
                 &cnfine,   &result                 );
</PRE>
<H4>Reference documents:</H4>
<UL>
<LI><SAMP><a href="../req/gf.html">gf.req</a></SAMP> - reference on the Geometry Finder (GF) subsystem of SPICE
</UL>

<HR>

<A NAME="O"></A><p align="right"><a href="#TOP"><small>Top</small></a></p>
<H3>Converting from and to rectangular coordinates</H3>

<H4>APIs:</H4>
<UL>
<LI><SAMP><a href="../cspice/reclat_c.html">reclat_c</a></SAMP> - converts from rectangular to latitudinal coordinates.
<LI><SAMP><a href="../cspice/latrec_c.html">latrec_c</a></SAMP> - converts from latitudinal to rectangular coordinates.
<LI><SAMP><a href="../cspice/srfrec_c.html">srfrec_c</a></SAMP> - converts from planetocentric lat/lon of a surface point on a body to rectangular coordinates.
<LI><SAMP><a href="../cspice/recgeo_c.html">recgeo_c</a></SAMP> - converts from rectangular to geodetic coordinates.
<LI><SAMP><a href="../cspice/georec_c.html">georec_c</a></SAMP> - converts from geodetic to rectangular coordinates.
<LI><SAMP><a href="../cspice/recpgr_c.html">recpgr_c</a></SAMP> - converts from rectangular to planetographic coordinates.
<LI><SAMP><a href="../cspice/pgrrec_c.html">pgrrec_c</a></SAMP> - converts from planetographic to rectangular coordinates.
<LI><SAMP><a href="../cspice/recrad_c.html">recrad_c</a></SAMP> - converts from rectangular coordinates to range, right ascension, and declination.
<LI><SAMP><a href="../cspice/radrec_c.html">radrec_c</a></SAMP> - converts from range, right ascension, and declination to rectangular coordinates.
<LI><SAMP><a href="../cspice/recsph_c.html">recsph_c</a></SAMP> - converts from rectangular to spherical coordinates.
<LI><SAMP><a href="../cspice/sphrec_c.html">sphrec_c</a></SAMP> - converts from spherical to rectangular coordinates.
<LI><SAMP><a href="../cspice/reccyl_c.html">reccyl_c</a></SAMP> - converts from rectangular to cylindrical coordinates.
<LI><SAMP><a href="../cspice/cylrec_c.html">cylrec_c</a></SAMP> - converts from cylindrical to rectangular coordinates.
</UL>


<H4>Brief Example:</H4>
<PRE>
   The following example computes the planetocentric, planetodetic and
   planetographic coordinates for a point given as a Cartesian vector
   with respect to Mars in the Mars body-fixed frame (IAU_MARS):

      SpiceDouble   vec[3];
      SpiceDouble   radii[3];
      SpiceDouble   f;
      SpiceDouble   pcr,   pclon, pclat;
      SpiceDouble   pdalt, pdlon, pdlat;
      SpiceDouble   pgalt, pglon, pglat;
      SpiceInt      n;

      /*
         load PCK file 
      */
      <a href="../cspice/furnsh_c.html">furnsh_c</a>( "pck00008.tpc" );

      /*
         retrieve Mars radii 
      */
      <a href="../cspice/bodvrd_c.html">bodvrd_c</a>( "MARS", "RADII", 3, &amp;n, radii );

      /*
         pack 3D vector 
      */
      <a href="../cspice/vpack_c.html">vpack_c</a> ( 3373.850, -351.034, -117.267, vec );

      /*
         compute planetocentric coordinates 
      */
      <a href="../cspice/reclat_c.html">reclat_c</a>( vec, &amp;pcr, &amp;pclon, &amp;pclat );

      /*
         compute planetodetic coordinates 
      */
      <a href="../cspice/recgeo_c.html">recgeo_c</a>( vec, radii[0], f, &amp;pdlon, &amp;pdlat, 
                &amp;pdalt );

      /*
         compute planetographic coordinates 
      */
      <a href="../cspice/recpgr_c.html">recpgr_c</a>( "MARS", vec, radii[0], f, &amp;pglon, &amp;pglat, 
                &amp;pgalt );
</PRE>

<HR>

<A NAME="P"></A><p align="right"><a href="#TOP"><small>Top</small></a></p>
<H3>Converting from and to Spherical Coordinates</H3>

<H4>APIs:</H4>
<UL>
<LI><SAMP><a href="../cspice/sphrec_c.html">sphrec_c</a></SAMP> - converts from spherical to rectangular coordinates.
<LI><SAMP><a href="../cspice/recsph_c.html">recsph_c</a></SAMP> - converts from rectangular to spherical coordinates.
<LI><SAMP><a href="../cspice/sphcyl_c.html">sphcyl_c</a></SAMP> - converts from spherical to cylindrical coordinates.
<LI><SAMP><a href="../cspice/cylsph_c.html">cylsph_c</a></SAMP> - converts from cylindrical to spherical coordinates.
<LI><SAMP><a href="../cspice/sphlat_c.html">sphlat_c</a></SAMP> - converts from spherical to latitudinal coordinates.
<LI><SAMP><a href="../cspice/latsph_c.html">latsph_c</a></SAMP> - converts from latitudinal to spherical coordinates.
</UL>

<H4>Brief Example:</H4>
<PRE>
   The following example computes the spherical coordinates of a point
   specified as a Cartesian vector:

      SpiceDouble   vec[3];
      SpiceDouble   r;
      SpiceDouble   colat;
      SpiceDouble   lon;

      <a href="../cspice/vpack_c.html">vpack_c</a>  ( 1.0, 1.0, 1.0, vec );

      <a href="../cspice/recsph_c.html">recsph_c</a> ( vec, &amp;r, &amp;colat, &amp;lon );
</PRE>

<HR>

<A NAME="Q"></A><p align="right"><a href="#TOP"><small>Top</small></a></p>
<H3>Converting from and to cylindrical coordinates</H3>

<H4>APIs:</H4>
<UL>
<LI><SAMP><a href="../cspice/cylrec_c.html">cylrec_c</a></SAMP> - converts from cylindrical to rectangular coordinates.
<LI><SAMP><a href="../cspice/reccyl_c.html">reccyl_c</a></SAMP> - converts from rectangular to cylindrical coordinates.
<LI><SAMP><a href="../cspice/cylsph_c.html">cylsph_c</a></SAMP> - converts from cylindrical to spherical coordinates.
<LI><SAMP><a href="../cspice/sphcyl_c.html">sphcyl_c</a></SAMP> - converts from spherical to cylindrical coordinates.
<LI><SAMP><a href="../cspice/cyllat_c.html">cyllat_c</a></SAMP> - converts from cylindrical to latitudinal coordinates.
<LI><SAMP><a href="../cspice/latcyl_c.html">latcyl_c</a></SAMP> - converts from latitudinal to cylindrical coordinates.
</UL>

<H4>Brief Example:</H4>
<PRE>
   The following example computes the cylindrical coordinates of a
   point specified as a Cartesian vector:

      SpiceDouble   vec[3];
      SpiceDouble   r;
      SpiceDouble   lon;
      SpiceDouble   z;

      <a href="../cspice/vpack_c.html">vpack_c</a>  ( 1.0, 1.0, 1.0, vec );

      <a href="../cspice/reccyl_c.html">reccyl_c</a> ( vec, &amp;r, &amp;lon, &amp;z );
</PRE>

<HR>

<A NAME="R"></A><p align="right"><a href="#TOP"><small>Top</small></a></p>
<H3>Converting from and to Latitudinal Coordinates</H3>

<H4>APIs:</H4>
<UL>
<LI><SAMP><a href="../cspice/latrec_c.html">latrec_c</a></SAMP> - converts from latitudinal to rectangular coordinates.
<LI><SAMP><a href="../cspice/reclat_c.html">reclat_c</a></SAMP> - converts from rectangular to latitudinal coordinates.
<LI><SAMP><a href="../cspice/latsph_c.html">latsph_c</a></SAMP> - converts from latitudinal to spherical coordinates.
<LI><SAMP><a href="../cspice/sphlat_c.html">sphlat_c</a></SAMP> - converts from spherical to latitudinal coordinates.
<LI><SAMP><a href="../cspice/latcyl_c.html">latcyl_c</a></SAMP> - converts from latitudinal to cylindrical coordinates.
<LI><SAMP><a href="../cspice/cyllat_c.html">cyllat_c</a></SAMP> - converts from cylindrical to latitudinal coordinates.
</UL>

<H4>Brief Example:</H4>
<PRE>
   The following example converts the planetocentric coordinates of a
   point to a Cartesian vector:
      
      SpiceDouble   vec[3];
      SpiceDouble   r   = 3390.42;
      SpiceDouble   lon =  175.30;
      SpiceDouble   lat =  -14.59;

      <a href="../cspice/latrec_c.html">latrec_c</a>( r, lon * <a href="../cspice/rpd_c.html">rpd_c</a>(), lat * rpd_c(), vec );
</PRE>

<HR>

<A NAME="S"></A><p align="right"><a href="#TOP"><small>Top</small></a></p>
<H3>Converting from and to R, RA, and DEC</H3>

<H4>APIs:</H4>
<UL>
<LI><SAMP><a href="../cspice/radrec_c.html">radrec_c</a></SAMP> - converts from range, right ascension, and declination to rectangular coordinates.
<LI><SAMP><a href="../cspice/recrad_c.html">recrad_c</a></SAMP> - converts from rectangular coordinates to range, right ascension, and declination.
</UL>


<H4>Brief Example:</H4>
<PRE>
   The following example computes the unit vector corresponding to an
   RA and DEC given in degrees:

      SpiceDouble   ra  = 120.0;
      SpiceDouble   dec = -30.0;
      SpiceDouble   vec[3];

      <a href="../cspice/radrec_c.html">radrec_c</a>( 1.0, ra * <a href="../cspice/rpd_c.html">rpd_c</a>(), dec * rpd_c(), vec );
</PRE>

<HR>

<A NAME="T"></A><p align="right"><a href="#TOP"><small>Top</small></a></p>
<H3>Converting from and to Geodetic Coordinates</H3>

<H4>APIs:</H4>
<UL>
<LI><SAMP><a href="../cspice/georec_c.html">georec_c</a></SAMP> - converts from geodetic to rectangular coordinates.
<LI><SAMP><a href="../cspice/recgeo_c.html">recgeo_c</a></SAMP> - converts from rectangular to geodetic coordinates.
</UL>

<H4>Brief Example:</H4>
<PRE>
   The following example converts the areodetic coordinates of a
   landing site (Lon = 175.3 deg, Lat = -14.59 deg, Alt = -1.91 km),
   given relative to the IAU 2000 Mars ellipsoid, to a Cartesian
   vector:

      SpiceDouble   lon;
      SpiceDouble   lat;
      SpiceDouble   alt;
      SpiceDouble   radii[3];
      SpiceDouble   f;
      SpiceDouble   vec[3];

      SpiceInt      n;

      <a href="../cspice/furnsh_c.html">furnsh_c</a>( "pck00008.tpc" );

      <a href="../cspice/bodvrd_c.html">bodvrd_c</a>( "MARS", "RADII", 3, &amp;n, radii );

      lon =  175.30 * <a href="../cspice/rpd_c.html">rpd_c</a>();
      lat =  -14.59 * <a href="../cspice/rpd_c.html">rpd_c</a>();
      alt =   -1.91;

      f = (radii[0]-radii[2])/radii[0];

      <a href="../cspice/georec_c.html">georec_c</a>( lon, lat, alt, radii[0], f, vec );
</PRE>

<HR>

<A NAME="U"></A><p align="right"><a href="#TOP"><small>Top</small></a></p>
<H3>Performing simple operations on 3D vectors</H3>

<H4>APIs:</H4>
<UL>
<LI><SAMP><a href="../cspice/vpack_c.html">vpack_c</a></SAMP> - packs three scalar components into a vector.
<LI><SAMP><a href="../cspice/vupack_c.html">vupack_c</a></SAMP> - unpacks three scalar components from a vector.
<LI><SAMP><a href="../cspice/vadd_c.html">vadd_c</a></SAMP> - adds two 3D vectors.
<LI><SAMP><a href="../cspice/vsub_c.html">vsub_c</a></SAMP> - computes the difference between two 3D vectors.
<LI><SAMP><a href="../cspice/vcrss_c.html">vcrss_c</a></SAMP> - computes the cross product of two 3D vectors.
<LI><SAMP><a href="../cspice/vdot_c.html">vdot_c</a></SAMP> - computes the dot product of two 3D vectors.
<LI><SAMP><a href="../cspice/vrel_c.html">vrel_c</a></SAMP> - returns the relative difference between two 3D vectors
<LI><SAMP><a href="../cspice/vscl_c.html">vscl_c</a></SAMP> - multiplies a scalar and a 3D vector.
<LI><SAMP><a href="../cspice/vminus_c.html">vminus_c</a></SAMP> - negates a 3D vector.
<LI><SAMP><a href="../cspice/vequ_c.html">vequ_c</a></SAMP> - makes one 3D vector equal to another.
<LI><SAMP><a href="../cspice/vzero_c.html">vzero_c</a></SAMP> - indicates whether a 3D vector is the zero vector.
<LI><SAMP><a href="../cspice/vsep_c.html">vsep_c</a></SAMP> - finds the separation angle between two 3D vectors.
<LI><SAMP><a href="../cspice/vdist_c.html">vdist_c</a></SAMP> - returns the distance between two 3D vectors.
<LI><SAMP><a href="../cspice/vnorm_c.html">vnorm_c</a></SAMP> - computes the magnitude of a 3D vector.
<LI><SAMP><a href="../cspice/vhat_c.html">vhat_c</a></SAMP> - finds the unit vector along a 3D vector.
<LI><SAMP><a href="../cspice/ucrss_c.html">ucrss_c</a></SAMP> - computes the normalized cross product of two 3D vectors.
<LI><SAMP><a href="../cspice/unorm_c.html">unorm_c</a></SAMP> - normalizes a 3D vector and return its magnitude.
</UL>

<H4>Brief Example:</H4>
<PRE>
   The following example prints the angular separation between two 3D
   vectors in degrees:

      SpiceDouble   a[3];
      SpiceDouble   b[3];

      <a href="../cspice/vpack_c.html">vpack_c</a>( 1.0, 0.0, 0.0, a );
      <a href="../cspice/vpack_c.html">vpack_c</a>( 1.0, 1.0, 0.0, b );

      printf( "angular separation, deg = %12.3f\n", 
              <a href="../cspice/vsep_c.html">vsep_c</a>(a,b) * <a href="../cspice/dpr_c.html">dpr_c</a>() );
</PRE>

<HR>

<A NAME="V"></A><p align="right"><a href="#TOP"><small>Top</small></a></p>
<H3>Projecting, Combining and Rotating 3D vectors</H3>

<H4>APIs:</H4>
<UL>
<LI><SAMP><a href="../cspice/vperp_c.html">vperp_c</a></SAMP> - finds the component of a 3D vector that is perpendicular to a second 3D vector.
<LI><SAMP><a href="../cspice/vproj_c.html">vproj_c</a></SAMP> - finds the projection of one 3D vector onto another 3D vector.
<LI><SAMP><a href="../cspice/vrotv_c.html">vrotv_c</a></SAMP> - rotates a 3D vector about a specified axis 3D vector by a specified angle.
<LI><SAMP><a href="../cspice/rotvec_c.html">rotvec_c</a></SAMP> - transform a 3D vector to a new coordinate system rotated by an angle about X, Y, or Z.
<LI><SAMP><a href="../cspice/vlcom_c.html">vlcom_c</a></SAMP> - computes the vector linear combination a*v1 + b*v2 of two 3D vectors.
<LI><SAMP><a href="../cspice/vlcom3_c.html">vlcom3_c</a></SAMP> - computes the vector linear combination a*v1 + b*v2 + c*v3 of three 3D vectors.
</UL>

<H4>Brief Example:</H4>
<PRE>
   The following example finds the projection of one 3D vector onto
   another 3D vector:

      SpiceDouble   a[3];
      SpiceDouble   b[3];
      SpiceDouble   c[3];

      <a href="../cspice/vproj_c.html">vproj_c</a>( a, b, c );
</PRE>

<HR>

<A NAME="W"></A><p align="right"><a href="#TOP"><small>Top</small></a></p>
<H3>Performing Simple Operations on 3x3 Matrices</H3>

<H4>APIs:</H4>
<UL>
<LI><SAMP><a href="../cspice/mxm_c.html">mxm_c</a></SAMP> - multiplies two 3x3 matrices.
<LI><SAMP><a href="../cspice/mxmt_c.html">mxmt_c</a></SAMP> - multiplies a 3x3 matrix and the transpose of another 3x3 matrix.
<LI><SAMP><a href="../cspice/mxv_c.html">mxv_c</a></SAMP> - multiplies a 3x3 matrix with a 3D vector.
<LI><SAMP><a href="../cspice/mtxm_c.html">mtxm_c</a></SAMP> - multiplies the transpose of a 3x3 matrix and a 3x3 matrix.
<LI><SAMP><a href="../cspice/mtxv_c.html">mtxv_c</a></SAMP> - multiplies the transpose of a 3x3 matrix on the left with a 3D vector on the right.
<LI><SAMP><a href="../cspice/vtmv_c.html">vtmv_c</a></SAMP> - multiplies the transpose of a 3D vector, a 3x3 matrix, and a 3D vector.
<LI><SAMP><a href="../cspice/xpose_c.html">xpose_c</a></SAMP> - transposes a 3x3 matrix.
<LI><SAMP><a href="../cspice/mequ_c.html">mequ_c</a></SAMP> - sets one 3x3 matrix equal to another.
<LI><SAMP><a href="../cspice/det_c.html">det_c</a></SAMP> - computes the determinant of a 3x3 matrix.
<LI><SAMP><a href="../cspice/trace_c.html">trace_c</a></SAMP> - returns the trace of a 3x3 matrix.
</UL>

<H4>Brief Example:</H4>
<PRE>
   The following example multiples two matrices and converts the
   resulting matrix to a SPICE-style quaternion:

      SpiceDouble   mat1[3][3];
      SpiceDouble   mat2[3][3];
      SpiceDouble   mat3[3][3];
      SpiceDouble   q[4];

      <a href="../cspice/mxm_c.html">mxm_c</a>( mat1, mat2, mat3 );
      <a href="../cspice/m2q_c.html">m2q_c</a>( mat3, q );
</PRE>

<HR>

<A NAME="X"></A><p align="right"><a href="#TOP"><small>Top</small></a></p>
<H3>Creating and Converting Transformation Matrices</H3>

<H4>APIs:</H4>
<UL>
<LI><SAMP><a href="../cspice/rotate_c.html">rotate_c</a></SAMP> - calculates the 3x3 matrix for a rotation of an angle about the X, Y or Z axis.
<LI><SAMP><a href="../cspice/rotmat_c.html">rotmat_c</a></SAMP> - applies a rotation of an angle about the X, Y, or Z axis to a matrix.
<LI><SAMP><a href="../cspice/twovec_c.html">twovec_c</a></SAMP> - builds the transformation to a frame based on two vectors.
<LI><SAMP><a href="../cspice/eul2m_c.html">eul2m_c</a></SAMP> - constructs a rotation matrix from a set of Euler angles.
<LI><SAMP><a href="../cspice/m2eul_c.html">m2eul_c</a></SAMP> - factors a matrix as a product of three rotations about specified axes.
<LI><SAMP><a href="../cspice/raxisa_c.html">raxisa_c</a></SAMP> - computes the axis of the rotation given by a matrix and the angle about that axis.
<LI><SAMP><a href="../cspice/axisar_c.html">axisar_c</a></SAMP> - construct a rotation matrix that rotates vectors by an angle about an axis.
<LI><SAMP><a href="../cspice/m2q_c.html">m2q_c</a></SAMP> - finds a unit quaternion corresponding to a specified rotation matrix.
<LI><SAMP><a href="../cspice/q2m_c.html">q2m_c</a></SAMP> - find the rotation matrix corresponding to a specified unit quaternion.
</UL>

<H4>Brief Example:</H4>
<PRE>
   The following example creates a transformation matrix from right
   ascension, declination, and twist given in degrees:

      SpiceDouble   ra    =   10.0;
      SpiceDouble   dec   =   20.0;
      SpiceDouble   twist = -135.0;
      SpiceDouble   mat[3][3];

      ra    = ra    * <a href="../cspice/rpd_c.html">rpd_c</a>();
      dec   = dec   * <a href="../cspice/rpd_c.html">rpd_c</a>();
      twist = twist * <a href="../cspice/rpd_c.html">rpd_c</a>();

      <a href="../cspice/eul2m_c.html">eul2m_c</a>( twist, <a href="../cspice/halfpi_c.html">halfpi_c</a>() - dec, ra, 3, 2, 3, mat );
</PRE>

<H4>Reference documents:</H4>
<UL>
<LI><SAMP><a href="../req/rotation.html">rotation.req</a></SAMP> - reference on different representations of rotation transformations
</UL>

<HR>

<A NAME="Y"></A><p align="right"><a href="#TOP"><small>Top</small></a></p>
<H3>Accessing Physical and Mathematical Constants</H3>

<H4>APIs:</H4>
<UL>
<LI><SAMP><a href="../cspice/halfpi_c.html">halfpi_c</a></SAMP> - returns half the value of pi.
<LI><SAMP><a href="../cspice/pi_c.html">pi_c</a></SAMP> - returns the value of pi.
<LI><SAMP><a href="../cspice/twopi_c.html">twopi_c</a></SAMP> - returns twice the value of pi.
<LI><SAMP><a href="../cspice/dpr_c.html">dpr_c</a></SAMP> - returns the number of degrees per radian.
<LI><SAMP><a href="../cspice/rpd_c.html">rpd_c</a></SAMP> - returns the number of radians per degree.
<LI><SAMP><a href="../cspice/spd_c.html">spd_c</a></SAMP> - returns the number of seconds in a day.
<LI><SAMP><a href="../cspice/jyear_c.html">jyear_c</a></SAMP> - returns the number of seconds per Julian year.
<LI><SAMP><a href="../cspice/tyear_c.html">tyear_c</a></SAMP> - returns the number of seconds per tropical year.
<LI><SAMP><a href="../cspice/clight_c.html">clight_c</a></SAMP> - returns the speed of light in vacuo (km/sec)
<LI><SAMP><a href="../cspice/b1900_c.html">b1900_c</a></SAMP> - returns the Julian Date corresponding to Besselian date 1900.0.
<LI><SAMP><a href="../cspice/b1950_c.html">b1950_c</a></SAMP> - returns the Julian Date corresponding to Besselian date 1950.0.
<LI><SAMP><a href="../cspice/j1900_c.html">j1900_c</a></SAMP> - returns the Julian Date of 1899 DEC 31 12:00:00 (1900 JAN 0.5).
<LI><SAMP><a href="../cspice/j1950_c.html">j1950_c</a></SAMP> - returns the Julian Date of 1950 JAN 01 00:00:00 (1950 JAN 1.0).
<LI><SAMP><a href="../cspice/j2000_c.html">j2000_c</a></SAMP> - returns the Julian Date of 2000 JAN 01 12:00:00 (2000 JAN 1.5).
<LI><SAMP><a href="../cspice/j2100_c.html">j2100_c</a></SAMP> - returns the Julian Date of 2100 JAN 01 12:00:00 (2100 JAN 1.5).
</UL>

<H4>Brief Example:</H4>
<PRE>
   The following example sets angle to pi/2 and prints it in degrees:

      SpiceDouble   angle;

      angle = <a href="../cspice/halfpi_c.html">halfpi_c</a>();

      printf( "angle, deg = %12.3f\n", angle * <a href="../cspice/dpr_c.html">dpr_c</a>() );
</PRE>

<HR>

</TD>
</TR>
</TBODY>
</TABLE>

</BODY>
</HTML>
